#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main()
{
	//string s1("hello world");
	//string s2,s3,s4,s5;
	////s1.push_back('x');
	//s1.append("xyz");
	/*5s2.append(s1);
	s3.append(s1, 2, 9);
	s4.append("xyyyyyy", 3);
	s5.append(3, 'x');
	s1.c_str(); */
	/*s2 += s1;s
	s2 += 'x';
	s2 += "jjiij";*/
	/*string s1("hello world");
	cout << s1.c_str()<< endl;
	s1.insert(6, 3, 'x');
	cout << s1.c_str() << endl;*/
	/*string s2("hello");
	size_t pos = s1.find('h', 1);
	cout << s1.size()- s1.find('h', 1) -1 << endl;*/
	//string s2("hello");
	///*cout << s2.substr(3, 5) << endl;*/
	//string s3("jjjjj");
	//string s4 = s3 + s2;
	/*string s2("hello");
	cout << s2 << endl;*/
	/*string s2;
	cin >> s2;
	cout << s2 << endl;*/
	/*string s2;
	getline(cin, s2, '/');
	cout << s2 << endl;*/
	/*string s1 = "hell";
	string s2 = "aadd";
	if (s1 == s2)
		cout << "equal" << endl;
	if (s1 != s2)
		cout << "not equal" << endl;
	if (s1 < s2)
		cout << "s2" << endl;
	if (s1 > s2)
		cout << "s1" << endl;
	if (s1 <= s2)
		cout << "equal and less" << endl;
	if (s1 >= s2)
		cout << "equal and more" << endl;*/
	//string s1("jjjj");
	/*for (int i = 0; i < s1.size(); i++)
	{
		cout << s1.at(i) << endl;
	}*/
	/*s1.back() = '!';
	cout << s1 << endl;
	cout << s1.back() << endl;*/
	/*s1.front() = '!';
	cout << s1 << endl;
	cout << s1.front() << endl;*/
	/*string s1("jjjj"); 
	string s2("xxx");
	s1.assign(s2);
	cout << s1 << "";
	cout << endl;
	s1.assign(s2,0,3);
	cout << s1 << "";
	cout << endl;
	s1.assign("xjie");
	cout << s1 << "";
	cout << endl;
	s1.assign("wed",2);
	cout << s1 << "";
	cout << endl;
	s1.assign(3,'x');
	cout << s1 << "";
	cout << endl;
	s1.assign(s2.begin(),s2.end());
	cout << s1 << "";*/
	string s1("jjidhe");
	string s2("sde");
	s1.replace(1, 2, s2);
	cout << s1 << "";
	cout << endl;
	s1.replace(0, 1, s2, 2,1);
	cout << s1 << "";
	cout << endl;
	s1.replace(1, 2, "111");
	cout << s1 << "";
	cout << endl;
	s1.replace(1, 2, "1111111",2);
	cout << s1 << "";
	cout << endl;
	s1.replace(1, 2, 3,'2');
	cout << s1 << "";
	cout << endl;
	s1.replace(s1.begin(), s1.end(), s2);
	s1.replace(1, 2, s2);
	cout << s1 << "";
	cout << endl;
	return 0;
}